package com.ruoyi.projects.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.projects.mapper.SlOrderDetailMapper;
import com.ruoyi.projects.domain.SlOrderDetail;
import com.ruoyi.projects.service.ISlOrderDetailService;

/**
 * 订单详情记录Service业务层处理
 * 
 * @author yangz
 * @date 2024-10-23
 */
@Service
public class SlOrderDetailServiceImpl implements ISlOrderDetailService 
{
    @Autowired
    private SlOrderDetailMapper slOrderDetailMapper;

    /**
     * 查询订单详情记录
     * 
     * @param id 订单详情记录主键
     * @return 订单详情记录
     */
    @Override
    public SlOrderDetail selectSlOrderDetailById(Long id)
    {
        return slOrderDetailMapper.selectSlOrderDetailById(id);
    }

    /**
     * 查询订单详情记录列表
     * 
     * @param slOrderDetail 订单详情记录
     * @return 订单详情记录
     */
    @Override
    public List<SlOrderDetail> selectSlOrderDetailList(SlOrderDetail slOrderDetail)
    {
        return slOrderDetailMapper.selectSlOrderDetailList(slOrderDetail);
    }

    /**
     * 新增订单详情记录
     * 
     * @param slOrderDetail 订单详情记录
     * @return 结果
     */
    @Override
    public int insertSlOrderDetail(SlOrderDetail slOrderDetail)
    {
        slOrderDetail.setCreateTime(DateUtils.getNowDate());
        return slOrderDetailMapper.insertSlOrderDetail(slOrderDetail);
    }

    /**
     * 修改订单详情记录
     * 
     * @param slOrderDetail 订单详情记录
     * @return 结果
     */
    @Override
    public int updateSlOrderDetail(SlOrderDetail slOrderDetail)
    {
        slOrderDetail.setUpdateTime(DateUtils.getNowDate());
        return slOrderDetailMapper.updateSlOrderDetail(slOrderDetail);
    }

    /**
     * 批量删除订单详情记录
     * 
     * @param ids 需要删除的订单详情记录主键
     * @return 结果
     */
    @Override
    public int deleteSlOrderDetailByIds(Long[] ids)
    {
        return slOrderDetailMapper.deleteSlOrderDetailByIds(ids);
    }

    /**
     * 删除订单详情记录信息
     * 
     * @param id 订单详情记录主键
     * @return 结果
     */
    @Override
    public int deleteSlOrderDetailById(Long id)
    {
        return slOrderDetailMapper.deleteSlOrderDetailById(id);
    }
}
